$(document).ready(function(){
   
   
   //弹出批量新增框
   $("#batchAddStudentBtn").click(function(){
         $("#uploadFileModal").modal("show");
   });
   //显示上传控制样式
    $("#uploadFile").ace_file_input({
    style:'well',
    btn_choose:'Drop files here or click to choose',
    btn_change:null,
    no_icon:'ace-icon fa fa-cloud-upload',
    droppable:true,
    thumbnail:'small',
    preview_error:function(filename,error_code){
    }
    
    }).on('change',function(){});
    
    //保存并导入Excel数据进行批量添加学生
    $("#subjectStudentSaveBtn").on('click',function(){
    	 $("#uploadFileModal").modal("hide");
   			 var path = $("#path").val();
    	$.ajaxFileUpload({
    url:path+'/uploadFile',
    secureuri:false,
    fileElementId:'uploadFile',
    dataType:'json',
    complete:function(data){
     //alert(data);
    },
    success:function(data,status){//服务器响应成功处理函数
		    if(data.success){
		       alert('成功');
		      parent.location.reload();
		    }else{
		       alert(data.messageMap.message);
		    }
    	},
    error:function(data,status,e){//服务器响应失败处理函数
            alert(e);
    }
    	
   					 }); 
    });
   
 });